<?php


namespace app\admin\model;


use think\Model;
use think\model\concern\SoftDelete;

class Budget extends Model
{
    use SoftDelete;
    protected $name = 'budget';


    public function admin()
    {
        return $this->belongsTo(Admin::class, 'admin_id');
    }

    public function ExamineAdmin()
    {
        return $this->belongsTo(Admin::class, 'examine_admin_id');
    }

    public function FinalAdmin()
    {
        return $this->belongsTo(Admin::class, 'final_admin_id');
    }


    public function AuthGroup()
    {
        return $this->belongsTo(AuthGroup::class, 'group_id');
    }

    public function ProjectBudget()
    {
        return $this->hasOne(ProjectBudget::class, 'project_id');
    }
    public function Budgets()
    {
        return $this->hasOne(ProjectBudget::class, 'project_id','project_id');
    }


    public function pb(){
        return $this->belongsTo(ProjectBudget::class, 'project_budget_id');
    }

    public function project(){
        return $this->belongsTo(Item::class, 'project_id');
    }
}
